﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Dogshow - Registracija naloga</title>
    <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/prijava.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("label").addClass("control-label");
            $("input[type='text']").addClass("input-xlarge");
            $("input[type='password']").addClass("input-xlarge");
            $(".alert").hide();

            $("form").submit(showLoader);

            $("#forgottenPassword").click(function () {
                showLoader();
                $.post('Prijava/GenerisiNovuLozinku', function (data) {
                    if (data == true) {
                        $(".alert").show();
                        hideLoader();
                    }
                });
                return false;
            });

            function showLoader() {
                $(".loader").show();
            }

            function hideLoader() {
                $(".loader").hide();
            }
        });
    </script>
</head>
<body>
    <div id="omotac">
        @using (Html.BeginForm("PrijaviMe", "Prijava", FormMethod.Post, new { @class = "form-horizontal" }))
        {
            <fieldset class="control-group">
                <legend>
                    <div>
                        <a href="@Url.Action("Index", "Home")">
                            <img src="@Url.Content("~/Content/images/DogshowLogo.png")" alt="Dogshow"/></a></div>
                    <h3>
                        Prijava</h3>
                </legend>
                <div class="control-group">
                    @Html.Label("username", "Korisničko ime:")
                    @Html.TextBox("username")
                </div>
                <div class="control-group">
                    @Html.Label("password", "Lozinka: ")
                    @Html.Password("password")
                </div>
                <div class="control-group">
                    <label class="control-label" for="rememberMe">
                        Zapamti me:
                    </label>
                    <label class="checkbox">
                        @Html.CheckBox("rememberMe")
                    </label>
                </div>
                <div class="control-group">
                    <input type="submit" value="Prijavi me" class="btn btn-large btn-success" />
                    <img class="loader" src="@Url.Content("~/Content/images/loader.gif")" width="32" height="32"/>
                </div>
                @if (ViewBag.Poruka != null)
                {
                    <p class="field-validation-error center">@ViewBag.Poruka</p>
                }
                <div id="opcije">
                    <a id="forgottenPassword" href="#">Zaboravljena lozinka?</a>
                    @Html.ActionLink("Registracija naloga", "Index", "RegistracijaNaloga")
                </div>
            </fieldset>
        }
        <div class="alert alert-info">
            <button class="close" data-dismiss="alert">×</button>
            <span>Nova lozinka je poslata na Vaš registrovani e-mail</span>
        </div>
    </div>
</body>
</html>
